#include "stdItemLib.h"

stdItemLib* stdItemLib::_instance = 0;

stdItemLib* stdItemLib::Instance()
{
	if (_instance == NULL)
	{
		_instance = new stdItemLib();
	}
	return _instance;
}

stdItemLib::stdItemLib()
{
	string str;
	ifstream infile;
	infile.open("gameinformation/itemInformation/list.txt");
	while (getline(infile, str))
	{
		_std.push_back(stdItem(str));
	}
}

stdItem stdItemLib::getItem(int i)
{
	if (i < _std.size())
	{
		return _std[i];
	}
	cout << "error";
	exit(1);
}